package com.stork.sms.utilities;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class SharedPreference {

	public static final String PREF_NAME = "EXAMPLE_COLLEGE_SHAREDPREFER";
	public static final int MODE = Context.MODE_PRIVATE;
	public static final String COLLEGE_NAME = "collegename";
	public static final String ADDRESS = "address";
	public static final String PHONE= "phone";
	public static final String EMAIL= "email";
	public static final String WEBSITE= "website";
	public static final String LOGIN_ID="username";
	public static final String PASSWORD="password";
	
	public static void writeString(Context context, String key, String value) {
        getEditor(context).putString(key, value).commit();

    }
    
    public static String readString(Context context, String key, String defValue) {
        return getPreferences(context).getString(key, defValue);
    }
    
    
	private static SharedPreferences getPreferences(Context context) {
		// TODO Auto-generated method stub
		return context.getSharedPreferences(PREF_NAME, MODE);
	}
	
	public static Editor getEditor(Context context)
	{
		return getPreferences(context).edit();
	}
}
